<!--
  @author duanzuocai
  @since 2018/10/23 15:12
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>部门列表</title>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">

        <!--面包屑-->
        <blockquote class="layui-crumb">
            组织关系>
            <a lay-href="/mc/dept/list.action" lay-text="部门管理" th:text="部门管理">部门管理</a>
            <zmn th:each="dept, deptState : ${depts}">
                <zmn th:if="${deptState.last}" th:text="${'>'+dept.deptName}"></zmn>
                <a th:if="${!deptState.last}" th:href="${'/mc/dept/list.action?parentId='+dept.deptId}" >>[[${dept.deptName}]]</a>
            </zmn>
        </blockquote>

        <div class="layui-split">&nbsp;</div>

        <form method="post" action="/mc/dept/list.action">
            <div class="layui-form" th:include="mc/dept/_query :: query "></div>
        </form>

        <div class="layui-card-body">
            <table class="layui-hide" id="zmn-mc-dept-table" lay-filter="zmn-mc-dept-table"></table>
            <script type="text/html" id="zmn-mc-dept-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group">
                        <zmn th:if="${#authPermit.checkPermit('/mc/dept/updateStatus.action')}">
                            <button class="layui-btn layui-btn-sm" lay-event="start">启用</button>
                            <button class="layui-btn layui-btn-sm layui-btn-danger " lay-event="stop">停用</button>
                        </zmn>
                    </div>
                    <div class="layui-btn-group">
                        <zmn th:if="${#authPermit.checkPermit('/mc/dept/detail.action')}">
                            <button class="layui-btn layui-btn-sm layui-btn-primary" th:lay-href="|/mc/dept/detail.action?parentId=${vo.parentId}|">添加部门</button>
                        </zmn>
                        <a th:href="|/mc/dept/list.action?parentId=${parent.parentId}|">
                            <button class="layui-btn layui-btn-sm layui-btn-primary">返回上级
                            </button>
                        </a>
                    </div>

                </div>
            </script>
        </div>

        <div class="layui-card-body">
            <table class="layui-hide" id="zmn-mc-dept-table" lay-filter="zmn-mc-dept-table"></table>
            <script type="text/html" id="zmn-serv-categ-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group">
                        <zmn th:if="${#authPermit.checkPermit('/mc/dept/updateStatus.action')}">
                        <button class="layui-btn layui-btn-sm" lay-event="start">启用</button>
                        <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="stop">停用</button>
                        </zmn>
                        <zmn th:if="${#authPermit.checkPermit('/mc/dept/detail.action')}">
                        <button class="layui-btn layui-btn-sm">
                            <i class="layui-icon"></i>
                            <a href="/mc/dept/detail.action">添加部门</a>
                        </button>
                        </zmn>
                    </div>
                </div>
            </script>
        </div>

    </div>
</div>

<script type="text/javascript" th:inline="javascript">

    var json = {
        hasView: [[${#authPermit.checkPermit('/mc/dept/list.action')}]],
        hasPermitList: [[${#authPermit.checkPermit('/mc/permit/data/list.action')}]],
        hasPermitView: [[${#authPermit.checkPermit('/mc/permit/data/detail.action')}]],
        hasEdit: [[${#authPermit.checkPermit('/mc/dept/detail.action')}]],
        hasEditName: [[${#authPermit.checkPermit('/mc/dept/updateName.action')}]],
        hasEditSort: [[${#authPermit.checkPermit('/mc/dept/updateSort.action')}]],
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]],
        items: [[${items}]]
    };
    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        art_dept_list: "mc/dept/zmn.art.mc.dept.list",
    }).use(['index', 'art_dept_list']);

</script>
</body>
</html>